<style>
.layui-input-block{
margin-left:120px;
}
</style>
<form class="layui-form" action="" id="orderEditForm">
<!-- 隐藏域用于传递ID -->
<input  class="form-control formSubmit layui-hide"  name="id" />
 <div class="layui-row"  style="margin-top:10px;">

	  <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
	    <label class="layui-form-label" style="width:120px;">公司名称</label>
	    <div class="layui-input-block" style="width:200px;">
	    		<select style="width:200px;height:28px;" name="company_id" lay-verify="required" required >
	      		   <option th:each="ec:${actCenterCompanyMap}" th:value="${ec.id}" th:text="${ec.name}" ></option> 
	      	   </select>
	    </div>
	  </div>
  	 
	  <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
		    <label class="layui-form-label" style="width:120px;">标题</label>
		    <div class="layui-input-block" style="width:200px;">
	      	   <input type="text" class="layui-input" lay-verify="required"  name="title"/>
		    </div>
	   </div>
  </div>
  
  
 <div class="layui-row" style="margin-top:10px;">
	  <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
	    <label class="layui-form-label" style="width:120px;" lay-filter="supplierContacts">状态</label>
	    <div class="layui-input-block" style="width:200px;">
	      	<select style="width:200px;height:28px;" name="status" lay-verify="required" required >
	      			<option value="" selected>请选择状态</option>
	      		   <option th:each="ec:${statusList}" th:value="${ec.key}" th:text="${ec.val}" ></option> 
	      	</select>
	    </div>
	  </div>
	  <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
	    <label class="layui-form-label" style="width:120px;" lay-filter="type">类型</label>
	    <div class="layui-input-block" style="width:200px;">
	    	<select style="width:200px;height:28px;" name="type" lay-verify="required" required >
	    			<option value="" selected>请选择类型</option>
	      		   <option th:each="ec:${typeList}" th:value="${ec.key}" th:text="${ec.val}" ></option> 
	      	</select>
	    </div>
	  </div>
 </div>
  <div class="layui-row" style="margin-top:10px;">
	  
	   <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
		    <label class="layui-form-label" style="width:120px;">内容</label>
	    <div class="layui-input-block" style="width:570px;">
	      <textarea class="layui-textarea layui-hide" name="content" lay-verify="content" id="LAY_demo_editor"></textarea>
	    </div>
	  </div>
  </div>
  
  <div class="layui-row" style="margin-top:10px;">
	  <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
		    <label class="layui-form-label" style="width:120px;">备注</label>
		    <div class="layui-input-block" style="width:570px;">
		      <textarea class="layui-textarea"  name="remark"></textarea>
		    </div>
	  </div>
  </div>
  
  
 <div class="layui-row" style="margin-top:20px;">
    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12" style="text-align:center;">
      	<button type="button" class="layui-btn" lay-submit="" lay-filter="formSubmit" id="submitBtn" autocode="900072">提交</button>
      	<button type="button" class="layui-btn layui-btn-primary" id="closeBtn">关闭</button>
    </div>
  </div>
</form>
<script>
layui.use('laydate', function(){
	  var laydate = layui.laydate;
	  lay('.outboundDate').each(function(){
		    laydate.render({
		      elem: this
		      ,type:'datetime'
		      ,trigger: 'click'
		    });
		  });
	});
	
layui.use(['form', 'layedit', 'laydate'], function(){
	  var form = layui.form
	  ,layer = layui.layer
	  ,layedit = layui.layedit
	  ,laydate = layui.laydate;
	  
	  var editIndex = layedit.build('LAY_demo_editor');
	form.render();
	
	form.on('submit(formSubmit)', function(data){
		layedit.sync(editIndex);
		  $.ajax({
	            type: "GET",
	            url: "/act/center/msg/create_execute",
	            data: $("#orderEditForm").serializeJson(),
	            dataType: "json",
	            success: function(data){
	            	if(data.code==200){
	           	    //更新表格数据
	           	    layer.msg(data.message,{icon: 6});
	           		//更新表格诗句
	           	 	reloadData();
	           		//关闭弹出层
	           	    layer.closeAll();
	            	}else{
	            		layer.msg(data.message,{icon: 2});
	            	}
	            }
	           });
		  //关闭弹出层
	   	    layer.closeAll();
	  });
	  
	  function reloadData(){
			$(".layui-laypage-btn")[0].click();//页面的确定按钮
			
		}
		 //关闭按钮
		  $("#closeBtn").click(function(){
			  layer.closeAll();
		  })
	});  
</script>
